# ============================================================
# * Copyright © hk. 2022-2025. All rights reserved.
# * File name: CMakeLists.txt
# * Author   : 苏木
# * Date     : 2025-05-22
# * Version  : 
# * Description: cmake version 3.16.3
# ============================================================
## https://cmake.com.cn/cmake/help/latest/guide/tutorial/index.html
## https://cmake.org/cmake/help/latest/

# 指定 CMake 的最低版本要求
# --------------------------------------------------
cmake_minimum_required(VERSION 3.10)


# 设置项目名称和使用的编程语言
# --------------------------------------------------
project(SPROJECT C)


# 指定可执行程序和源文件
# --------------------------------------------------
add_executable(app_demo.out main.c)


# 逻辑操作符 CMake支持AND、OR和NOT逻辑操作符，可以使用括号控制优先级。
# --------------------------------------------------
message(STATUS "==> AND")
set(A ON)
set(B OFF)
if(A AND B)
	message(STATUS "if(A AND B)")
else()
	message(STATUS "else(A AND B)")
endif()
message("")

message(STATUS "==> OR")
set(A ON)
set(B OFF)
if(A OR B)
	message(STATUS "if(A OR B)")
else()
	message(STATUS "else(A OR B)")
endif()
message("")

message(STATUS "==> A AND B OR C")
set(A ON)
set(B OFF)
set(C ON)
if(A AND B OR C)
	message(STATUS "if(A AND B OR C)")
else()
	message(STATUS "else(A AND B OR C)")
endif()
message("")

message(STATUS "==> A AND (B OR C)")
set(A ON)
set(B OFF)
set(C ON)
if(A AND (B OR C))
	message(STATUS "if(A AND (B OR C))")
else()
	message(STATUS "else(A AND (B OR C))")
endif()
message("")
